home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / mint / lib / mntlib44.zoo / mntlib / Bugs < prev    next >
Text File  |  1994-03-01  |  13KB  |  258 lines

  1. This text files describes some bugs in the MiNT library, as well as some
  2. ways in which the library's behaviour differes from most UNIX systems.  If
  3. the document looks like I'm talking to myself in places, it's because it was
  4. originally compiled by boender@dutiws.TWI.TUDelft.NL (Hildo Biersma), and
  5. I've marked it up to use as a sort of checklist of things to fix.  Since
  6. some of these problems will be resolved in later releases of the library,
  7. try not to depend too heavily on the behavior described here.
  8.  
  9. entropy@terminator.rs.itd.umich.edu (Nick Castellano)
  10.  
  11. --------------------------------------------------------------------------
  12.  
  13. *.c: ++boender
  14.   Currently, the code for the mintlibs does various checks
  15.   according to the various versions of MiNT. Now, this is all very
  16.   well, but in some cases, this causes *three* versions of the
  17.   code to exist: TOS, old MiNT and new MiNT. Should this be cleaned
  18.   up at some time, i.e. do we stop supporting MiNT before 0.8 or 0.9?
  19.   Some obvious candidates are killpg.c and unx2dos.c.
  20.  
  21. *.h:  ++boender
  22.   I have a problem using gcc and GNU programs. If a Makefile from a
  23.   GNU program sets a gcc parameter of -I../lib, and a C file does
  24.   #include "wait.h", "../lib/wait.h" will be included. Now this file
  25.   includes <sys/wait.h>, which does an #include <wait.h>. This, in turn,
  26.   includes the GNU lib/wait.h! (Wow, recursive, recursive, .....)
  27.   
  28.   This could be solved in various ways. I make a symbolic link to
  29.   <sys/wait.h> from <wait.h>. <sys/wait.h> could do a #include "../wait.h".
  30.   The parameter -I/usr/include could be added in the GNU Makefile.
  31.   For you to decide upon the correct action!
  32.  
  33.   [I just read this for the 90th time and I finally understand what's being
  34.   said (I can be pretty dense sometimes. <grin>) I've hopefully made it
  35.   impossible for this to go into an infinite loop by changing the include
  36.   protection in some of the sys/*.h files.  Now it should just unwind the
  37.   second time it hits the sys/wait.h file (or other sys/ file) and
  38.   eventually your compile will bomb because it never got the correct
  39.   definitions from the include file.  That should be easier to track down
  40.   than a hung compiler, at least. -entropy]
  41.  
  42. access.c: ++entropy
  43.   I think my "superuser can access anything" assumption is wrong, especially
  44.   if checking execute permissions.
  45.  
  46. alarm.c: ++entropy
  47.   alarm() will silently "round down" any requested time greater than
  48.   LONG_MAX / 1000 (approximately 2 million seconds).  Most UNIXes allow much
  49.   larger maximum values (usually LONG_MAX).  MiNT needs this extremely small
  50.   maximum value because wakeup scheduling is calculated in milliseconds by
  51.   the kernel.  This cannot be fixed without changing MiNT.  alarm() does not
  52.   work at all under TOS.
  53.  
  54. clock.c: ++boender, ++entropy
  55.   clock() is currently implemented as an alias for _clock(), which makes it
  56.   hopelessly different from the UNIX version, since it returns time elapsed
  57.   since the program started, and not the CPU time used by the process and
  58.   its children that have terminated so far.  Also, the time units used are
  59.   different (200 Hz ticks instead of microseconds).  When clock() is fixed,
  60.   CLOCKS_PER_SEC in time.h will need to be changed, as ANSI specifies that
  61.   clock()/CLOCKS_PER_SEC gives the CPU time used, in seconds, since the
  62.   beginning of execution.  It may be a good idea to change CLK_TCK to agree,
  63.   or maybe CLK_TCK should be used for the actual 200 Hz hardware tick, and
  64.   change only CLOCKS_PER_SEC.  CLK_TCK is used in times.c.  CLOCKS_PER_SEC
  65.   is used in sleep.c.
  66.  
  67. crtinit.c: ++nox
  68.   Some programs like uuxqt (taylors at least) understand exit code
  69.   EX_TEMPFAIL (75) to mean retry the command (uux job) later.  Now when
  70.   _crtinit can't initialize it does Pterm(-1) and uuxqt thinks the job can't
  71.   be retried, although it probably can...  so would it make sense to use
  72.   Pterm(EX_TEMPFAIL) instead?  Or maybe make this exit code compile-time
  73.   configurable like __default_mode__...
  74.  
  75. getopt.c, unistd.h: ++boender
  76.   The three externally usable variables defined in getopt.c should be
  77.   included in <unistd.h>, where getopt() is declared too.  These
  78.   are: 'extern char *optarg', 'extern int opterr' and 'extern int optind'.
  79.   [Not really a bug.  Leave it this way because UNIX doesn't have these
  80.   vars in any headers either. -entropy]
  81.  
  82. getrusag.c, wait3.c, resource.h: ++entropy
  83.   Most of the struct rusage members are fake.
  84.   
  85. ioctl.c: ++nox
  86.   TIOCSETP is #defined to be == TIOCSETN, but they are not really...
  87.   also still looks like it disables RTSCTS every time, unless i
  88.   specifically set that bit (0x2000), and thats not #defined in ioctl.h.
  89.   (and more things like TIOCFLUSH... but Eric knows them already. :-)
  90.  
  91. kill.c: ++boender, ++entropy 
  92.   On UNIX (SysV), system processes (PID 0 and 1) are treated specially.
  93.   This is somewhat different under MiNT, where init(1), if run at all, need
  94.   not have PID 1.  PID 0 is already treated in the correct manner by
  95.   Pkill().  PID 1 really deserves special treatment under MiNT in any case,
  96.   because shooting signals at MiNT's child process (be it init(1), or some
  97.   shell, or whatever) isn't likely to have the expected results.  I'm not
  98.   sure if this can reasonably be resolved in the library alone.
  99.  
  100.   Ultrix defines a system process as any process with a parent PID of 0.
  101.   This definition may be helpful for implementing kill() correctly in the
  102.   library.
  103.  
  104.   The man page for the MiNT call Pkill() forgets to mention that
  105.   either the effective user ID of the caller must be zero (super-user) or
  106.   else the real user IDs must match.  Note that, on UNIX, the caller must
  107.   be super-user or else the real or effective user IDs of both processes
  108.   must match.  This might be a bug in MiNT or the MiNT documentation.
  109.   Ask Eric?
  110.  
  111. limits.h: ++Uwe_Ohse@pb2.maus.de
  112.   CLK_TCK should be defined here and not just in time.h, since SVR4 does.
  113.   [I disagree, limits.h should be strictly ANSI and is already polluted
  114.   as it is -entropy]
  115.  
  116. link.c: ++nox
  117.   link() returns the same error code for different things i.e. EACCESS when
  118.   it really means EEXIST.
  119.  
  120. localtim.c: ++nox
  121.   Fix localtime() etc. to get the start/end DST rules from $TZ...
  122.  
  123. main.c: ++boender
  124.   In exit(), stdin, stdout and stderr are flushed, all other file
  125.   descriptors are closed. I don't know what POSIX says, but System V
  126.   wants stdin, stdout and stderr to be closed too.
  127.  
  128. mkfifo.c: ++entropy
  129.   The mkfifo() function is fake.  It always returns failure.
  130.  
  131. mknod.c: ++entropy
  132.   The current "emulation" of mknod() is really silly, it does nothing at
  133.   all and indicates that an error occurred.  We could at least try to
  134.   emulate properly for the kinds of files we know how to make (directories,
  135.   regular files, etc).
  136.  
  137. mktemp.c: ++entropy
  138.   Produces different sorts of filenames than UNIX does.
  139.  
  140. open.c: ++entropy
  141.   open() returns -4 instead of -1 on errors when __MSHORT__ is defined (but
  142.   only in certain cases).
  143.  
  144. open.c: ++nox
  145.   Should open() do a TIOCSPGRP too when it Fforces the control tty?
  146.   I think, but i'm not 100% sure...
  147.   [The kernel does this for us automagically. -entropy]
  148.  
  149. pgrp.c: ++entropy
  150.   The setsid() function never really disassociates the controlling tty from
  151.   the current process, since MiNT doesn't seem to have any such concept.  It
  152.   gets around this with a bunch of kludges in setsid(), ioctl(), and open().
  153.  
  154. popen.c: ++boender
  155.   This function reads the environment variable SHELL to find your shell,
  156.   and takes /bin/sh as an alternative. I think the opposite should be
  157.   done: only take SHELL of /bin/sh does not exist.
  158.   [See my comments on system.c -entropy]
  159.  
  160. read.c, write.c: ++entropy
  161.   When a backgrounded process is reading from or writing to its controlling 
  162.   tty, and its process group has no controlling tty, it should get a return
  163.   value of -1 from the read() or write() with errno set to EIO.  I'm
  164.   not really sure what the controlling tty of a process _group_ is, so
  165.   I'm clueless as to how to try to implement this.
  166.  
  167. scanf.c: ++jrb
  168.   Evidently loses big time.  Run Gcctests and find out what's what.
  169.  
  170. sigactio.c, sigblock.c: ++nox@jelal.north.de, ++entropy
  171.   sigblock() and sigsetmask() could be declared int at least #ifndef